﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using System.Xml;

namespace Parallel3M.parallel3m.framework
{
    public class ParallelChannel:ParallelElement
    {
        public ConcurrentQueue<ParallelPayload> queue = new ConcurrentQueue<ParallelPayload>();

        public void AddPayload(ParallelPayload payload)
        {
            payloadcount++;
            queue.Enqueue(payload);
        }

        public ParallelPayload GetPayload()
        {
            ParallelPayload payload;
            queue.TryDequeue(out payload);
            return payload;
        }
               
    }
}
